package org.walkerljl.boss.service;

import org.springframework.stereotype.Component;
import org.walkerljl.boss.service.schedule.DefaultJobFilter;
import org.walkerljl.boss.service.schedule.PrintHelloWorldJob;
import org.walkerljl.commons.schedule.JobDetail;
import org.walkerljl.commons.schedule.Scheduler;
import org.walkerljl.commons.schedule.defaults.DefaultScheduler;
import org.walkerljl.commons.schedule.enums.JobType;
import org.walkerljl.commons.schedule.filter.JobFilter;
import org.walkerljl.commons.standard.CannotStartException;
import org.walkerljl.commons.standard.CannotStopException;
import org.walkerljl.commons.standard.Machine;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * Bootstrap
 *
 * @author lijunlin
 */
@Component("bootstrap")
public class Bootstrap implements Machine {

    @Resource(name="monitorMachine")
    private Machine monitorMachine;

    @PostConstruct
    @Override
    public void start() throws CannotStartException {
        monitorMachine.start();
    }

    @PreDestroy
    @Override
    public void stop() throws CannotStopException {
        monitorMachine.stop();
    }
}
